package com.tencent.iov.cowin.befsale.clue.repository.cus;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.ClueTaskDataHistory;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.ClueIntentionGradeDataRequest;
import com.tencent.iov.cowin.befsale.clue.domain.cus.po.OemCustomerFollowRecord;
import com.tencent.iov.cowin.befsale.clue.domain.cus.vo.CustomerBehaviorStatistical;
import org.apache.ibatis.session.RowBounds;

import java.util.Date;
import java.util.List;

/**
 * @Describe: 总部线索跟进记录_Manager接口层
 * @author: xiamu
 * @created: 2021-12-21 18:37:32
 * @version: 1.0
 */
public interface OemCustomerFollowRecordManager {

    /**
     * 单条数据插入OemCustomerFollowRecord
     *
     * @param request
     * @return 插入的条数
     */
    int insert(OemCustomerFollowRecord request);

    /**
     * 批量插入OemCustomerFollowRecord
     *
     * @param requests
     * @return 批量插入的条数
     */
    int insertBatch(List<OemCustomerFollowRecord> requests);

    /**
     * 通过ID获取详细信息
     *
     * @param: id
     * @return: OemCustomerFollowRecord对象
     */
    OemCustomerFollowRecord getDetailById(Long id);

    /**
     * 单条OemCustomerFollowRecord更新
     *
     * @param request
     * @return 更新的条数
     */
    int update(OemCustomerFollowRecord request);

    /**
     * 通过ID删除数据
     *
     * @param id
     * @return 删除的条数
     */
    int delete(Integer id);

    /**
     * 根据条件查询对象list列表
     *
     * @param request
     * @return 查询结果
     */
    List<OemCustomerFollowRecord> getListByParam(OemCustomerFollowRecord request);

    /**
     * 根据条件查询对象page记录
     *
     * @param request
     * @return
     */
    Page<OemCustomerFollowRecord> getPageByParam(OemCustomerFollowRecord request, RowBounds rowBounds);

    /**
     * 根据条件查询单个对象
     *
     * @param request
     * @return 查询结果
     */
    OemCustomerFollowRecord getOneByParam(OemCustomerFollowRecord request);

    /**
     * 统计跟进行为标签
     * @param startDate 统计开始时间
     * @param endDate 统计结束时间
     * @param statues 分类1数据
     * @return 统计结果
     */
    List<CustomerBehaviorStatistical> statisticalByStatus(Date startDate, Date endDate, List<Integer> statues);

    /**
     * 统计分类2行为标签(到店接待、试乘试驾、战败激活)
     * @param startDate 统计开始时间
     * @param endDate 统计结束时间
     * @param secondStatues 分类2数据
     * @return 统计结果
     */
    List<CustomerBehaviorStatistical> statisticalBySecondStatus(Date startDate, Date endDate, List<Integer> secondStatues);

    /**
     * 根据状态统计记录表
     * add by zly
     * @param clueIntentionGradeDataRequest
     * @return
     */
    Integer getRecordFollowUpData(ClueIntentionGradeDataRequest clueIntentionGradeDataRequest);

    /**
     * 以月份分组，查询月份对应的逾期数量
     * add by zly
     * @param clueIntentionGradeDataRequest
     * @return
     */
    List<ClueTaskDataHistory> getRecordFollowUpHistoryData(ClueIntentionGradeDataRequest clueIntentionGradeDataRequest);
}